<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>商品信息添加页面</title>
  <link rel="stylesheet" href="../../../yl/index.css" />
  <!-- 布局样式 -->
  <link rel="stylesheet" href="../../../yl/style.css" />
  <link rel="stylesheet" href="../../../style/wangeditor.css">
  <link rel="stylesheet" href="../../../yl/mobile.css" />
  <link rel="stylesheet" href="../../../yl/easyui.css" />
  <link rel="stylesheet" href="../../../yl/icon.css" />
</head>

<body>
  <!-- <div id="app"> -->
  <div class="easyui-navpanel" id="app" v-cloak>
    <header>
      <div class="m-toolbar">
        <div class="m-title">{{action=='Add'?'添加入库单':action=='Modify'?'修改入库单':''}}</div>
      </div>
    </header>
    <div class="easyui-navpanel panel-body panel-body-nobottom panel-body-noborder" style="height: 3000px"
      id="MainTable" ref="MainTable"
      :data-options="JSON.stringify({ 'TableName': 'article_inventory_enter', 'form': 'dataForm' ,'primary_key':'Article_Inventory_Enter_SerialNumber' })">
      <div class="yl-main">
        <div class="table_titel">
          <div class="titel">入库信息</div>
        </div>
        <el-form :model="dataForm" ref="form" :inline-message="true" style="width: 100%">
          <el-descriptions :column="1" size="large" border>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">入库商品</div>
              </template>
              <el-form-item prop="Article_SerialNumber"
                :rules="[{ required: true, message: '请选择入库商品', trigger: 'change' }]">
                <yl-select @change="changeArticle" v-model="dataForm.Article_SerialNumber" clearable filterable
                  placeholder="请选择入库商品" :options="article_info"
                  :props="{value:'Article_SerialNumber',label:'Article_Name'}">
                  <el-table-column prop="Article_SerialNumber" show-overflow-tooltip label="商品流水号"></el-table-column>
                  <el-table-column prop="Article_Name" show-overflow-tooltip label="蓝牌名称"></el-table-column>
                  <el-table-column prop="Picture_URL" show-overflow-tooltip label="规格名称">
                    <template v-slot="{row}">
                      <el-image style="width: 100px; height: 100px" :src="photo + row.Picture_URL"
                        fit="contain"></el-image>
                    </template>
                  </el-table-column>
                  <el-table-column prop="Brand_Name" show-overflow-tooltip label="品牌名称"></el-table-column>
                  <el-table-column prop="Category_Name" show-overflow-tooltip label="类别名称"></el-table-column>
                </yl-select>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">入库规格</div>
              </template>
              <el-form-item prop="Specifications_SerialNumber"
                :rules="[{ required: true, message: '请选择入库规格', trigger: 'change' }]">
                <yl-select :disabled="!dataForm.Article_SerialNumber" v-model="dataForm.Specifications_SerialNumber"
                  clearable filterable placeholder="请选择入库规格" :options="article_specifications"
                  :props="{value:'Specifications_SerialNumber',label:'Specifications_Name'}">
                  <el-table-column prop="Specifications_SerialNumber" show-overflow-tooltip
                    label="规格流水号"></el-table-column>
                  <el-table-column prop="Specifications_Name" show-overflow-tooltip label="规格名称"></el-table-column>
                  <el-table-column prop="Picture_URL" show-overflow-tooltip label="规格名称">
                    <template v-slot="{row}">
                      <el-image style="width: 100px; height: 100px" :src="photo + row.Picture_URL"
                        fit="contain"></el-image>
                    </template>
                  </el-table-column>
                  <el-table-column prop="Party_Point" show-overflow-tooltip label="兑换所需党员积分"></el-table-column>
                  <el-table-column prop="Villager_Point" show-overflow-tooltip label="兑换所需村民积分"></el-table-column>
                </yl-select>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">入库时间</div>
              </template>
              <el-form-item prop="Inventory_Enter_Datetime"
                :rules="[{ required: true, message: '请选择入库时间', trigger: 'change' }]">
                <el-date-picker v-model="dataForm.Inventory_Enter_Datetime" type="datetime" placeholder="请选择入库时间"
                  class="borderless-input" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"
                  size="large" />
              </el-form-item>
            </el-descriptions-item>
          </el-descriptions>
        </el-form>
        <div id="ChildTable">
          <div class="table_titel">
            <div class="titel">入库明细</div>
            <div class="operation">
              <el-button type="primary" size="small" @click="handleAdd('childDataForm')">新增</el-button>
              <el-button type="danger" size="small" @click="handleRemove('childDataForm')">删除</el-button>
            </div>
          </div>
          <el-form :model="{childDataForm:childDataForm.filter(item => item.Row_Status != '1')}" ref="form1"
            :inline-message="true" style="width: 100%">
            <el-descriptions :column="2" size="large" border style="margin-bottom: 10px;"
              v-for="(item,index) in childDataForm.filter(item => item.Row_Status != '1')" :key="index"
              :data-options="JSON.stringify({ 'TableName': 'article_inventory_enter_detail', 'form': 'childDataForm', 'ParentTableName': 'article_inventory_enter'})">
              <el-descriptions-item>
                <template #label>
                  <div class="cell-item">商品来源</div>
                </template>
                <el-form-item :prop="'childDataForm.'+index+'.Article_Source'"
                  :rules="[{ required: true, message: '请输入商品来源', trigger: 'blur' }]">
                  <el-input v-model="item.Article_Source" class="borderless-input" placeholder="请输入商品来源" />
                </el-form-item>
              </el-descriptions-item>
              <el-descriptions-item>
                <template #label>
                  <div class="cell-item">入库数量</div>
                </template>
                <el-form-item :prop="'childDataForm.'+index+'.Inventory_Enter_Quantity'"
                  :rules="[{ required: true, message: '请输入入库数量', trigger: 'blur' }]">
                  <el-input v-model="item.Inventory_Enter_Quantity" class="borderless-input" placeholder="请输入入库数量" />
                </el-form-item>
              </el-descriptions-item>
            </el-descriptions>
          </el-form>
          <div class="table_titel">
            <div class="titel">附件</div>
          </div>
          <el-descriptions :column="2" size="large" border
            :data-options="JSON.stringify({'TableName': 'article_inventory_enter_attachment', 'form': 'childDataForm2', 'ParentTableName': 'article_inventory_enter'})">
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">附件</div>
              </template>
              <yl-upload ref="ylUpload" drag @success="success" @remove="remove"
                :limit="99" :file="fileList"></yl-upload>
            </el-descriptions-item>
          </el-descriptions>
        </div>
      </div>
    </div>
    <footer class="botton-ann">
      <el-button @click="goBack">返回</el-button>
      <el-button type="primary" plain @click="handleSubmit" :loading="loading">提交</el-button>
    </footer>
  </div>
</body>
<script src="../../../utils/utils.js"></script>
<script src="../../../config/config.js"></script>
<script src="../../../utils/compressor.js"></script>
<script src="../../../utils/wangeditor.js"></script>
<script src="../../../utils/mixins.js"></script>
<script src="../../../yl/vue.js"></script>
<script src="../../../yl/index.js"></script>
<script src="../../../yl/zh-cn.mjs"></script>
<script src="../../../yl/index.iife.min.js"></script>
<script src="../../../yl/jquery.min.js"></script>
<script src="../../../utils/jquery.cookie.js"></script>
<script src="../../../yl/jquery.easyui.min.js"></script>
<script src="../../../yl/jquery.easyui.mobile.js"></script>
<script src="../../../yl/moment.min.js"></script>
<script src="../../../api/request.js"></script>
<script src="./js/add.js"></script>

</html>